package com.zhangsr.zus.remoting.api.exchange;

import com.zhangsr.zus.remoting.api.Channel;
import com.zhangsr.zus.remoting.api.exception.RemotingException;

/**
 * @Author: zhangsr
 */
public interface ExchangeChannel extends Channel {
    /**
     * send request.
     *
     * @param request
     * @param timeout
     * @return response future
     * @throws RemotingException
     */
    ResponseFuture request(Object request, int timeout) throws RemotingException;

    /**
     * get message handler.
     * 
     * @return message handler
     */
    ExchangeHandler getExchangeHandler();

    /**
     * graceful close.
     * 
     * @param timeout
     */
    void close(int timeout);

}
